<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style type="text/css">
.main{
margin:5px 100px;}
</style>
</head>
<body>
<div class="main">
  <h1>文件列表</h1>
<table class="table">
 <tr><th>名称</th><th>创建日期</th><th>操作</th></tr>
<?php
require_once('db.php');
$db=new ResourceDB();
$lst=$db->SelectAll();
foreach($lst as $resource)
{
	print "<tr>
	<td>$resource->Name1</td>
	<td>$resource->CreateTime</td>
	<td>
	<input class='btn btn-default' type='button' value='播放' onclick='play(\"$resource->Id\")'>
	</td>
	</tr>";
}
?>
</table>
</div>
</body>
</html>

<script>
function play(id){
	window.open("play.php?Id="+id,"_blank");
	}

</script>